package com.wzy.web.pojo;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import org.hibernate.annotations.GenericGenerator;

/**
 * PmArticle entity.
 * 
 * @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "pm_article", catalog = "saozhe")
public class PmArticle implements java.io.Serializable {

	// Fields

	private Integer articleId;
	private PmUser pmUser;
	private String articleName;
	private String articleContent;
	private String dateTime;
	private PmProject pmProject;
	// Constructors

	/** default constructor */
	public PmArticle() {
	}

	/** full constructor */
	public PmArticle(PmUser pmUser, String articleName, String articleContent,
			String dateTime,PmProject pmProject) {
		this.pmUser = pmUser;
		this.articleName = articleName;
		this.articleContent = articleContent;
		this.dateTime = dateTime;
		this.pmProject = pmProject;
	}

	// Property accessors
	@GenericGenerator(name = "generator", strategy = "increment")
	@Id
	@GeneratedValue(generator = "generator")
	@Column(name = "articleId", unique = true, nullable = false)
	public Integer getArticleId() {
		return this.articleId;
	}

	public void setArticleId(Integer articleId) {
		this.articleId = articleId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "articleAuthor", nullable = false)
	public PmUser getPmUser() {
		return this.pmUser;
	}

	public void setPmUser(PmUser pmUser) {
		this.pmUser = pmUser;
	}

	@Column(name = "articleName", nullable = false, length = 100)
	public String getArticleName() {
		return this.articleName;
	}

	public void setArticleName(String articleName) {
		this.articleName = articleName;
	}

	@Column(name = "articleContent", nullable = false, length = 16777215)
	public String getArticleContent() {
		return this.articleContent;
	}

	public void setArticleContent(String articleContent) {
		this.articleContent = articleContent;
	}

	@Column(name = "dateTime", nullable = false, length = 20)
	public String getDateTime() {
		return this.dateTime;
	}

	public void setDateTime(String dateTime) {
		this.dateTime = dateTime;
	}
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "projectId", nullable = false)
	public PmProject getPmProject() {
		return pmProject;
	}

	public void setPmProject(PmProject pmProject) {
		this.pmProject = pmProject;
	}
}